package ch.zbw.sysVentory.run;



import ch.zbw.sysVentory.daten.Speicher;
import ch.zbw.sysVentory.erhebung.Sender;

public class MeinThread extends Thread {
    
    private final Speicher sp;
    private long warTime;

    public MeinThread(Speicher sp) {
	this.sp = sp;
	warTime = System.currentTimeMillis();
    }
    
    @Override
    public void run(){
	while(!isInterrupted()){
	    long divTime = 21600000;
	    long istTime = System.currentTimeMillis();
	    if (istTime>(warTime+divTime)){
		Sender.SENDDATA(sp);
		warTime = istTime;
	    }
	    try {
		Thread.sleep(10000);
	    } catch (InterruptedException e) {
		this.interrupt();
	    }
	}
    }

}
